package models.application;

import java.util.List;

import javax.persistence.*;

import models.pubobj.AniObjectState;
import models.user.AniUser;

import play.data.format.Formats;
import play.data.validation.Constraints;
import play.db.ebean.Model;

@Entity
public class AniAppClassification extends Model {

	public enum AppClassifications{
		ANI_SYSTEM_APP,
		EDUCATION,
		INDUSTRY,
		TECHNOLOGY
	}
	@Id
	public Long id;
	
	public String classificationKey;

    public AniAppClassification(String classificationKey) {
        this.classificationKey = classificationKey;
    }

    public AniAppClassification(Long id) {
        this.id = id;
    }

    public static AniAppClassification getById(Long classificationId){
        return find.byId(classificationId);
    }

    public static AniAppClassification getByClassificationKey(String classificationKey){
        return find.where().eq("classificationKey", classificationKey).findUnique();
    }

    public static Model.Finder<Long, AniAppClassification> find = new Model.Finder<Long, AniAppClassification>(Long.class, AniAppClassification.class);
	
	public static List<AniAppClassification> findAll() {
        return find.all();
    }
}
